package saucaca.fragment;

import java.util.ArrayList;

import lemon.kenhnhacvn.R;
import saucaca.Adapter.SongQueueAdapter;
import saucaca.Object.SongObject;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;


public class MainListeningPlaylistQueue extends Fragment{

	ListView listView;
	Context context;
	ArrayList<SongObject> listsongs;
	public SongQueueAdapter adapterQueueAdapter;
	public MainListeningPlaylistQueue(Context context, ArrayList<SongObject> listsongs) {
		this.context=context;
		this.listsongs=listsongs;
		adapterQueueAdapter=new SongQueueAdapter(context, listsongs);
	}
	public void update( ArrayList<SongObject> listsongs,int index){
		adapterQueueAdapter.setListSong(listsongs);
		adapterQueueAdapter.setPotitionIndicator(index);
	}
	@Override
	public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.listening_playlist_queue, container, false);
		findviewbyid(view);
		listView.setAdapter(adapterQueueAdapter);
		return view;
	}
	void findviewbyid(View view){
		listView=(ListView) view.findViewById(R.id.listViewQueue);
	}
}
